/**
 * 
 */
package com.thor.palmmall.rest.vkcommunicate.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.vkcommunicate.AVKCommunicateDetail;
import com.thor.palmmall.spi.vkcommunicate.SVKCommunicateDetail;

/**
 * @author Captian
 *
 * @since 1.0
 */
public class SVKCommunicateDetailConverter
    implements Converter<AVKCommunicateDetail, SVKCommunicateDetail> {

  public static SVKCommunicateDetailConverter getInstance() {
    if (instance == null)
      instance = new SVKCommunicateDetailConverter();
    return instance;
  }

  private static SVKCommunicateDetailConverter instance;

  private SVKCommunicateDetailConverter() {
  }

  @Override
  public SVKCommunicateDetail convert(AVKCommunicateDetail source) {
    if (source == null) {
      return null;
    }
    SVKCommunicateDetail target = new SVKCommunicateDetail();
    target.setNumber(source.getNumber());
    target.setCommunicateDate(source.getCommunicateDate());
    target.setContent(source.getContent());
    return target;
  }

}
